package rok3.projekt.zespver3.client.objects;

import rok3.projekt.zespver3.network.packet.__CharacterState;

import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.scenes.scene2d.ui.Image;

public class Character extends Image {
	public static enum Move { NOMOVE, UP, DOWN, LEFT, RIGHT, UP_LEFT, UP_RIGHT, DOWN_LEFT, DOWN_RIGHT };
	
	private float speed;
	private float hp;
	private float speed_diagonal;
	private short id;

	public Character( Texture texture, short id, float hp, float speed ) {
		super(texture);
		this.speed = speed;
		this.speed_diagonal = (float) (speed/Math.sqrt(2));
		this.hp = hp;
		this.id = id;
	}
	
	
	public float getSpeed(){
		return speed;
	}
	
	public float getDiagonalSpeed(){
		return speed_diagonal;
	}
	
	public void applyState(__CharacterState state ) {
		this.setPosition(state.x, state.y);
		this.setRotation(state.rotation);
		this.hp = state.hp;
	}

	public void setHp(float hp) {
		this.hp = hp;
	}
}
